home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
bignum.exe
/
BIGNUM.DOC
< prev
next >
Wrap
Text File
|
1990-03-22
|
11KB
|
227 lines
BIGNUM.TPU
&
BIG_RPN.EXE
Copyright 1989,1990
by:
Stephen A. Theberge
76 Wheaton Drive
Attleboro, MA 02703
(508)226-0447
CIS (Compuserve) # 73030,3644
GEnie Address: S.THEBERGE
All rights reserved.
PLEASE READ BIGNUM.DOC & BIGNUM.LIC FILES BEFORE RUNNING THESE
PROGRAMS.
Registration: $39.95 (check or money order).
Version 2.01
03/21/90 (Testing finished).
The following *.tpu files were compiled with Borland
International's Turbo Pascal v. 5.0 and 5.5. It is designed to
be used as a unit to be accessed by other Turbo Pascal v 5.0 or
5.5 programs. If you are using Turbo Pascal v 5.0, rename
BIGNUM.5 to BIGNUM.TPU, or if you are using Turbo Pascal v.
5.5, rename *.55 to *.tpu. These units were compiled on an
IBM PC/XT (8088). With your registration, you get the
complete source code (BIGNUM.PAS) allowing compilation on any
system. You also get the source code for BIG_RPN.EXE, This is the
complete menu driven system for saving and retrieving formula and
variable values to be accessed by the BIGNUM string math library.
FILES
BIGNUM.5, 255 digit accuracy string mathematics library for
Turbo Pascal v. 5.0.
BIGNUM.55, 255 digit accuracy string mathematics library for
Turbo Pascal v. 5.5.
Odds.pas, odds calculator showing BIGNUM (R)'s accuracy.
BIGNUM.LIC, licensing agreement for BIGNUM.* files.
BIG_RPN.EXE, stand alone program for saving, retrieving and
evaluating mathematical formulas in up to 255 decimal digits.
Part 1.
BIG_RPN.EXE (For all users).
BIG_RPN.EXE is the complete compiled menu driven system. If
you are not a programmer or are not interested in how the libraries
are used, than read Part 1. If you intend to write programs using
the functions in the BIGNUM (R) library, than skip to part 2.
"So," you ask, "why do I need a menu driven program to
evaluate formulas, save and retrieve formula and variable values?"
The answer is ease of use. Also, the accuracy of the
variables in these formulas are 255 floating point digits. You are
not restricted to know if the number is an integer or a real. It
doesn't matter. Just enter the numbers freehand in menu option 1.
Don't worry about scientific notation for now. That will come in a
later version.
VALID NUMBERS
All floating point numbers are valid: 1.234, 99.555, -777.9,
etc. Integers are also valid: 999999999999999, -1, etc. Just be
sure not to enter numbers like: 1E+09, 1..39 or 1dd, etc. The
program doesn't allow you to do this anyway, but you still have to
watch out for --1, -000.5, 9..3, 55.-, etc.
FORMULAS
Any math formula like (a+b)*(c/d) is acceptable. You have
letters A-H to chose from. You have 8 formulas to enter into. See
main menu option 2. No numbers like (1+3/3) are accepted, as you
can enter the values for them (A,B,C,D,E,F,G,H) in menu option 1.
NOTE:
+, addition: a+b, 'a' added to 'b'.
-, subtraction: a-b, subtract 'b' from 'a'.
*, multiplication: a*b, multiply 'a' by 'b'.
/, division: a/b, divide 'a' bye 'b'.
!, factorial: a!, a factorial. (a+b)! ('a' plus 'b')
factorial.
², square: a², a squared, square a, or a*a.
½, root: √a, square root of a or a½ (a to the 1/2).
In menu option 2, to enter !, ² and ½:
! is shift key and number 1.
² is obtained by the letter 'S', pressing the letter 'S' in
menu option 2 gives the symbol ².
½ is obtained by the letter 'R', pressing the letter 'R' in
menu option 2 gives the symbol ½.
SAVE & RETRIEVE VALUES
Don't forget to save your variables and formulas! (Option 4 of
main menu). Give the DOS file nume you want when prompted. Any
valid DOS name will do here. Menu option 3 allows you to retrieve
your old or previously saved values.
WHEN YOU ARE 'BAD'
Evaluate the formulas you have defined in menu option 5. You
get the INFIX (normal formula) RPN (hence BIG_RPN) which is the way
compilers, calculators and BIGNUM evaluates the formula, BIGNUM
FORMAT (How you might program the formula into a BIGNUM program),
RPN evaluation (or the answer you want) and length of bignum
string, or how many digits the answer is. If you are only
interested in the numerical value, look at RPN EVALUATION=.
If you see 'bad', then you may not have, 1, defined a
variable, defined a formula or there may simply be overflow like
with a calculator. Other strange errors can occur. Try entering a
formula with unbalanced parentheses or no operators.
TWO TIER REGISTRATION OF BIGNUM
Choice 1: $39.95. Source code for BIG_RPN.EXE and BIGNUM.TPU.
Technical support. One free upgrade of the
source code.
Choice 2: $15.00. Technical support for BIG_RPN.EXE ONLY.
One free upgrade of BIG_RPN.EXE.
Part 2.
PROGRAMMERS
BIGNUM.TPU (BIGNUM (R) library in Turbo Pascal Programs).
The user or programmer has seven mathematical functions to
chose from. These are and take the form:
1. x := plus(s1,s2,checked); {string addition}
2. x := minus(s1,s2,checked);{string subtraction}
3. x := times(s1,s2,checked);{string multiplication}
4. x := divide(s1,s2,checked,no_decimals);{string division}
5. x := square(s1);{string, square a number}
6. x := fac(s1);{string factorial--very useful! a little slow}
7. x := root(s1);{string square root---important! takes
approximately 75 seconds to calculate on an 8088 at 8 Mhz.
The variables x, s1 and s2 are Pascal string type variables.
All the function can accept either a value or variable reference as
their arguments. Checked and no_decimals are boolean type
variables and all the functions that use them can be either by
variable name or constants.
It is recommended that the variable "checked" be set to FALSE
at the beginning of any program that will use them unless you are
sure the data s1 and s2 falls in the set of real numbers. The
variable no_decimals should